package com.smedi.ismedi.personnel.api.dto.response;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.util.StringUtils;

import java.io.Serializable;

/**
 * @Author: xulinjun
 * @Date: 2021-6-15 17:12
 */
@Data
@Accessors(chain = true)
public class PersonSyncFromImisPaginationResponse implements Serializable {
    @ApiModelProperty(value = "同步id数据")
    private Long referencePersonId;

    @ApiModelProperty(value = "姓名")
    private String lastName;

    @ApiModelProperty(value = "工号")
    private String employeeNum;

    @ApiModelProperty(value = "身份证")
    private String idCard;

    @ApiModelProperty(value = "性别")
    private String genderMeaning;

    @ApiModelProperty(value = "邮箱")
    private String email;

    @ApiModelProperty(value = "手机号")
    private String mobile;

    @ApiModelProperty(value = "座机")
    private String officeTelephone;

    @ApiModelProperty(value = "从事职务")
    private String hrJob;

    @ApiModelProperty(value = "组织编码")
    private String orgCode;

    @ApiModelProperty(value = "组织简称")
    private String orgShortName;

    @ApiModelProperty(value = "二级组织简称")
    private String subOrgShortName;

    public void setIdCard(String idCard) {
        // 返回前端脱敏处理
        String idCardText = idCard;
        if (!StringUtils.isEmpty(idCard)) {
            idCardText = idCard.substring(0, idCardText.length()-6) + "******";
        }
        this.idCard = idCardText;
    }
}
